package com.ssy.lingxi.pay.common;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 授信申请下级内部状态
 * @author 伍将
 * @date 2021/1/12
 * @version 2.0.0
 */
public enum CreditApplyLowerInnerStatusEnum {

    ALL(0, "所有"),
    /**
     * 待提交 - 1
     */
    WAIT_SUBMIT(1, "待提交"),
    /**
     * 已提交 - 2
     */
    SUBMIT(2, "已提交");

    private final Integer code;


    CreditApplyLowerInnerStatusEnum(Integer code, String message) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(),this.code);
    }

    public static String getItemMessage(Integer code) {
        return Arrays.stream(CreditApplyLowerInnerStatusEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(ALL).getMessage();
    }
}
